#include <bits/stdc++.h>
using namespace std;
const int _ = 1e6 + 10;
int n, h[_], r[_], R[_];
inline long double calc(int i, int j) {
    if (R[i] <= r[j]) {
        return h[i];
    } else if ((long long) (h[i]) * (R[j] - r[j]) >= (long long) (h[j]) * (R[i] - r[i])) {
        if (R[i] <= R[j]) {
            return max(0.0L, (long double) (h[i]) - (long double) (h[j]) * ((long double)(R[i] - r[j]) / (long double)(R[j] - r[j])));
        } else {
            return max(0.0L, (long double) (h[i]) * ((long double) (R[j] - r[i]) / (long double) (R[i] - r[i])) - (long double) (h[j]));
        }
    } else {
        return max(0.0L, (long double) (h[i]) * ((long double) (r[j] - r[i]) / (long double) (R[i] - r[i])));
    }
}
long double dp[_], ans;
int main() {
    freopen("wan.in", "r", stdin);
    freopen("wan.out", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> h[i] >> r[i] >> R[i];
    }
    dp[1] = 0.0L;
    for (int i = 2; i <= n; i++) {
        dp[i] = 0.0L;
        for (int j = i-1; j >= 1; j--) {
            if (dp[j] + 1e9 < dp[i]) break;
            dp[i] = max(dp[i], dp[j] + calc(j, i));
        }
    }
    ans = 0.0L;
    for (int i = 1; i <= n; i++) {
        ans = max(ans, dp[i] + h[i]);
    }
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
}